﻿using System;

using Bootstrap5.Abstractions;

using Microsoft.AspNetCore.Components;

namespace Bootstrap5;

[CssClass("tab-pane")]
[HtmlRole("tabpanel")]
public class TabItem : BootstrapChildContentWithChildCascadingComponentBase<TabItem,Tab>
{
    [Parameter][HtmlProperty("id")] public string Alias { get; set; } = $"tab-item-{Guid.NewGuid().ToString()}";
    [Parameter] public string Title { get; set; }
    [Parameter] [CssClass("fade")] public bool Fade { get; set; } = true;
    [Parameter] [CssClass("show active")] public bool Active { get; set; }
    [Parameter] public bool Disabled { get; set; }

    protected override void OnInitialized()
    {
        ThrowIfParentNull();

        Parent.AddItem(this);
    }
}
